var sign = document.getElementById("sign");
sign.onclick = function(){
//	var username = document.getElementById("reg_username");
//	var password = document.getElementById("reg_pwd");
//	var password_rep = document.getElementById("reg_pwd_repeat");
	loadXMLDoc();
	
}

function loadXMLDoc()
{
  var xmlhttp;
  if (window.XMLHttpRequest)
  {
    // IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
    xmlhttp=new XMLHttpRequest();
  }
  else
  {
    // IE6, IE5 浏览器执行代码
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  xmlhttp.onreadystatechange=function()
  {
    if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
      console.log(xmlhttp.responseText);
    }
  }
//xmlhttp.open("GET","http://127.0.0.1:3000/user?username=Adam6&password=abcd&password_repeat=abcd",true);
//xmlhttp.send();
var json = '{"username":"Adam","password":"abcd"}';
xmlhttp.open("POST","http://127.0.0.1:3000/login",true);
xmlhttp.setRequestHeader("Content-type","application/json");
xmlhttp.send(json);
}
